package com.example.demo.services.imp;

import com.example.demo.entity.teacherLogin;
import com.example.demo.entity.userLogin;
import com.example.demo.mapper.userLoginMapper;
import com.example.demo.services.userLoginServices;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class userLoginSerImp implements userLoginServices {


    @Autowired
    private userLoginMapper userLoginMapper;

    @Override
    public List<userLogin> selectall() {
        List<userLogin> test=userLoginMapper.selectall();
        return userLoginMapper.selectall();
    }

    @Override
    public Integer adduser(String id, String name, String loginuser, String password) {
        return userLoginMapper.inseruserLogin(id, name, loginuser, password);
    }

    @Override
    public userLogin selectLogin(String loginName, String password) {
        return userLoginMapper.selectPassword(loginName, password);
    }

    @Override
    public teacherLogin selectTeacher(Integer id, String name) {
        return userLoginMapper.selectTeacher(id, name);
    }

    //id为userID
    @Override
    public Integer updateLogin(String name, String id) {
        return userLoginMapper.updateLogin(name, id);
    }

    @Override
    public Integer updatePassword(String userId, String password) {
        return userLoginMapper.updatePassword(userId, password);
    }
}
